/*
 * Project CHEN Rendering Engine : /sampler.hpp
 * Created: 2020-12-16, Last modified:  2021-02-16
 * 
 * This is the default descriptor.
 * 
 * Copyright (C) 2021 Hineven (hineven@pku.edu.cn)
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef _H_SAMPLER
#define _H_SAMPLER
#include "heads.hpp"
namespace chen {

class Sampler {
public:
    // The default constructor of a sampler
    inline Sampler() {}
    // Move toward to next sample, add 1 to the sample
    // index and set the current sampling dimension to 0.
    virtual void nextSample () = 0;
    // Return a point generated by next 2 sample dimensions
    // and automatically increase the current dimension indice
    // by 2.
    virtual Point2 gen2D () = 0;
    // Return a series of 2D samples
    virtual Point2* gen2DArray (int len)  = 0;
    virtual Float gen () = 0;
    virtual Float* genArray (int len) = 0;
    virtual Sampler * clone (unsigned seed) = 0;
    virtual void setSampleIndex (int i) = 0;
    virtual ~Sampler () {}
};

}
#endif
